<template>
	<view class="info_detail">
		<view class="info_item">
			<view class="basic_main">
				<view>客户名称</view>
				<view>{{info.customer?info.customer.name:''}}</view>
			</view>
			<view class="basic_main">
				<view>联系人</view>
				<view>{{info.contacts?info.contacts.name:''}}</view>
			</view>
			<view class="basic_main">
				<view>负责人</view>
				<view>{{info.owner_staff?info.owner_staff.name:''}}</view>
			</view>
			<view class="basic_main">
				<view>发货仓库</view>
				<view>{{info.warehouse?info.warehouse.name:''}}</view>
			</view>
			<form-item v-for="(item,index) in listForm" :key="index" :objInfo="item" :isEdit="false"></form-item>
		</view>
		<!-- 审批流程 -->
		<approval-status :process="payment_approval"></approval-status>
	</view>
</template>

<script>
	import { netSetForm } from '@/api/index.js'
	import formItem from '@/components/form/formitem.vue'
	
 	export default{
		components:{
			formItem
		},
		props:{
			info:{
				type:Object,
				default:{}
			},
			payment_approval:{   //审批流程
				type:Object,
				default:{}
			}
		},
		data() {
			return{
				listForm:[],
			}
		},
		created() {
			//获取 form
			this.getForm()
		},
		methods:{
			getForm() {
				netSetForm({type:'delivery'}).then(res=>{
					res = res.data.data
					res.forEach(ele=>{
						ele.value = this.info[ele.id]
					})
					this.listForm = res
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.info_detail {
		margin-bottom: 100rpx;
		.basic_head {
			display: flex;
			padding: 30rpx 24rpx 30rpx;
			:last-child {
				font-weight: 700;
				margin-left: 8rpx;
			}
		}
		.basic_main {
			display: flex;
			justify-content: space-between;
			padding: 0 32rpx;
			background-color: #fff;
			height: 90rpx;
			line-height: 90rpx;
			border-bottom: 1rpx solid #EAEAEA;
			:first-child {
				color: #999;
			}
			>view{
				font-size: 32rpx;
			}
		}
	}
	
</style>